<template>
	<view>
		<view class="dingguding">
			<view class="dianpuxx">
				<view class="gerxinx">
					<image class="mendtup" v-if="touxiang==null||touxiang==''||touxiang=='undefined'"
						src="../../static/dengl.jpg" mode="aspectFill"></image>
					<image class="mendtup" v-else :src="imgUrl+touxiang" mode="aspectFill"></image>
					<view class="mendxx">
						<view class="dianpum">{{name==null?'李晓明':name}}</view>
						<view class="dizhi">
							<view>{{role==1?'理发师':role==2?'门店':role==3?'区域经理':role==4?'城市经理':role==5?'老板':'理发师'}}</view>
							<!-- <view class="zhib">值班</view> -->
						</view>
					</view>
				</view>

				<view class="caozuo">
					<image class="cctybia" src="../../static/dianh.png"></image>
					<image class="cctybia" src="../../static/yhbianj.png"></image>
				</view>
			</view>
			<view class="jindulan">
				<view class="liangb">
					<view>业绩进度</view>
					<view>70%</view>
				</view>
				<view class="waiku">
					<view class="jindu" />
				</view>
			</view>
		</view>
		<view class="xiabygl">
			<view class="xinxisek">
				<view>要求业绩</view>
				<view class="xxxq">5000</view>
			</view>
			<view class="xinxisek">
				<view>已完成</view>
				<view class="xxxq">3800</view>
			</view>
			<view class="xinxisek">
				<view>服务人数</view>
				<view class="xxxq">435</view>
			</view>
			<view class="xinxisek">
				<view>提成</view>
				<view class="xxxq">763</view>
			</view>
			<view class="xinxisek">
				<view>推广人数</view>
				<view class="xxxq">1231</view>
			</view>
			<view class="xinxisek">
				<view>分成</view>
				<view class="xxxq">314</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgUrl: this.$imgUrl,
				ygid: '',
				touxiang: '',
				name: '',
				role: '',
				census:{},
				curMonth:'',
				allData:{}
			}
		},
		onLoad(option) {
			// console.log(333,option)
			this.ygid = option.ygid
			this.getStaffData(option.ygid)
		},
		methods: {
		
			//获取员工数据
			getStaffData(id) {
				let _that = this;
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let dateNew = `${year}-${month}`;
				_that.curMonth=dateNew.substring(5,7)
				uni.request({
					url: getApp().globalData.url + '/client/GetUsrenw',
					method: 'GET',
					data: {
						id: id,
						yuef:dateNew
					},
					header: {
						"Content-Type": "application/json"
					},
					success: function(res) {
						console.log(555,res)

						if (res.data.code == 200 && res.data.msg == '查询成功') {
							_that.allData = res.data.data;

						} else {
							uni.showToast({
								icon: 'none',
								position: 'center',
								title: "请求出现异常！"
							});
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.dingguding {
		width: 650rpx;
		padding: 30rpx 50rpx;
		background: #f8f8f8;

		// position: fixed;
		// top: 44px;
		// z-index: 99;
		.dianpuxx {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.gerxinx {
				display: flex;
				align-items: center;

				.mendtup {
					width: 100rpx;
					height: 100rpx;
					border-radius: 10rpx;
				}

				.mendxx {
					margin-left: 10rpx;

					.dianpum {
						font-size: 30rpx;
						font-weight: bold;
					}

					.dizhi {
						display: flex;
						align-items: center;
						font-size: 25rpx;
						color: #2979FF;

						.zhib {
							padding: 5rpx 20rpx;
							font-size: 25rpx;
							background: #ff007f;
							border-radius: 20rpx;
							color: #ffffff;
							margin-left: 10rpx;

						}

						.xiuxi {
							padding: 5rpx 20rpx;
							font-size: 25rpx;
							background: #d0d0d0;
							border-radius: 20rpx;
							color: #838383;
							margin-left: 10rpx;

						}
					}
				}
			}

			.caozuo {
				display: flex;
				align-items: center;
				justify-content: space-between;
				width: 150rpx;
				margin-right: 20rpx;

				.cctybia {
					width: 60rpx;
					height: 60rpx;
				}
			}


		}

		.jindulan {
			font-size: 28rpx;
			color: #676767;
			margin-top: 30rpx;

			.liangb {
				display: flex;
				align-items: center;
				justify-content: space-between;
			}

			.waiku {
				margin-top: 15rpx;
				width: 650rpx;
				height: 25rpx;
				background: #d8d8d8;
				border-radius: 13rpx;

				.jindu {
					width: 70%;
					height: 25rpx;
					background: #ff007f;
					border-radius: 13rpx;
				}
			}
		}
	}

	.xiabygl {
		width: 690rpx;
		padding: 30rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		align-items: center;

		// margin-top: 250rpx;
		.xinxisek {
			width: 230rpx;
			height: 100rpx;
			background: #eaeaea;
			border-radius: 20rpx;
			padding: 50rpx;
			font-size: 25rpx;
			color: #4d4d4d;
			margin-bottom: 30rpx;

			.xxxq {
				font-weight: bold;
				font-size: 50rpx;
				margin-top: 10rpx;
				color: #ff007f;
			}
		}

	}
</style>
